package com.guyaogg.gulimall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.guyaogg.common.utils.PageUtils;
import com.guyaogg.gulimall.member.entity.MemberEntity;
import com.guyaogg.gulimall.member.execption.EmailExistException;
import com.guyaogg.gulimall.member.execption.PhoneExistException;
import com.guyaogg.gulimall.member.execption.UsernameExistException;
import com.guyaogg.gulimall.member.vo.GiteeSocialUser;
import com.guyaogg.gulimall.member.vo.MemberLoginVO;
import com.guyaogg.gulimall.member.vo.MemberRegisterVO;

import java.util.Map;

/**
 * 会员
 *
 * @author guyao
 * @email 3039744913@qq.com
 * @date 2021-10-08 17:17:46
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void regist(MemberRegisterVO vo);

    /**
     * 查看邮箱是否唯一
     * @param email
     *
     */
    void checkEmailUnique(String email) throws EmailExistException;
    /**
     * 查看 username 是否唯一
     * @param username
     */
    void checkUsernameUnique(String username) throws UsernameExistException;
    /**
     * 查看 mobile 是否唯一
     * @param mobile
     */
    void checkMobileUnique(String mobile) throws PhoneExistException;

    MemberEntity login(MemberLoginVO vo);

    MemberEntity oauth2GiteeLogin(GiteeSocialUser vo) throws Exception;
}

